package com.wy.system.custom;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class CustomUser extends User {
  /**
   * 我们自己的用户实体对象，要调取用户信息时直接获取这个实体对象
   */
  private com.wy.model.entity.User user;

  public CustomUser(com.wy.model.entity.User user, Collection<? extends GrantedAuthority> authorities) {
    super(user.getUsername(), user.getPassword(), authorities);
    this.user = user;
  }

  public com.wy.model.entity.User getUser() {
    return user;
  }

  public void setUser(com.wy.model.entity.User user) {
    this.user = user;
  }
}
